<template>

  <div class="register-container">
    <div class="register-main">
      <div class="register-form-wrapper">
        <h3 class="register-label">用户注册</h3>

        <a-form-model class="register-form"
                      :model="form"
                      :rules="rules"
                      ref="form"
                      @submit="">

          <a-form-model-item prop="username">
            <a-input size="large"
                     placeholder="用户名"
                     v-decorator="rules.username"
                     v-model="form.username"
                     allowClear>
              <template #prefix>
                <a-icon type="user" style="color: rgba(0,0,0,.25)"/>
              </template>
            </a-input>
          </a-form-model-item>

          <a-form-model-item prop="password">
            <a-input size="large"
                     type="password"
                     placeholder="密码"
                     v-decorator="rules.password"
                     v-model="form.password"
                     allowClear>
              <template #prefix>
                <a-icon type="lock" style="color: rgba(0,0,0,.25)"/>
              </template>
            </a-input>
          </a-form-model-item>


        </a-form-model>


      </div>
    </div>
  </div>


</template>

<script>

  // 校验规则
	const rules = {
		username: [{
			required: true,
			whitespace: true,
			message: '请输入用户名!'
		}],
		password: [{
			required: true,
			message: '请输入密码!'
		}]
	};

	export default {
		name: "UserRegister",
    data() {
			return {
				rules,
				form: {
					username: null,
					password: null
				}
      }
    }
	}
</script>

<style lang="scss" scoped>

  .register-container {
    position: relative;
    height: 100vh;
    background: #F5F5FF;
    border-top: 1px solid #F5F5FF;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
  }

  .register-main {
    position: absolute;
    left: 50%;
    /*top: 30%;*/
    transform: translate(-120%, 10%);
  }

  .register-form-wrapper {
    padding: 32px 64px;
    width: 600px;
    height: 700px;
    overflow: hidden;
    box-shadow: 0 0 20px 0 #F1F3F5;
    background: #FFFFFF;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
    position: relative;

    .register-label {
      color: #181E33;
      font-size: 20px;
      margin-bottom: 24px;
      font-weight: normal;
    }

  }

</style>

